Hello,
 
I have a CMakeLists.txt who contains the following :
 
project(sql_sqlite)
 
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /D_USRDLL /DSQL_SQLITE_EXPORTS 
/D_UNICODE /DUNICODE")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi /GL /Oi /Gy /O2 
/GR- /Gm- /OPT")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /WX- /ZI /Oy- /Gm /EHsc 
/MDd /GS /Gd ")
 
                set_source_files_properties(../sql_sqlite/stdafx.cpp PROPERTIES 
COMPILE_FLAGS "/Ycstdafx.h")
                set_source_files_properties(../sql_sqlite/sql_sqlite.cpp 
PROPERTIES COMPILE_FLAGS "/Yustdafx.h")
                set_source_files_properties(../sql_sqlite/win32/main.cpp 
PROPERTIES COMPILE_FLAGS /Yu"../stdafx.h")  
                set_source_files_properties(../../../external/sqlite/sqlite3.c 
PROPERTIES COMPILE_FLAGS "/Y-")
 
add_library(
 
                               sql_sqlite
 
                               SHARED
 
                                ../sql_sqlite/stdafx.h
                                ../../../external/sqlite/sqlite3.h
                
                               ../sql_sqlite/sql_sqlite.cpp
                                ../sql_sqlite/stdafx.cpp
                                ../sql_sqlite/win32/main.cpp    
                                ../../../external/sqlite/sqlite3.c
                
)
 
I've stdafx.cpp and sql-sqlite.cpp with #include "stdafx.h" (for them that's 
ok), but main.cpp with #include "../stdafx.h" doesn't work. When I generate 
Makefile with the NMake Makefiles generator, and type « nmake » I've the 
following issue :
 
« fatal error C1083: Cannot open precompiled header file: '../stdafx.pch': No 
such file or directory »
 
Why he doesn't find the stdafx.pch ?
I've trying many way to resolve this problem : use backslah, slash, in 
CMakeLists.txt or my main.cpp.. Nothing works. 
How I can resolve this problem ? Is there a way to force it or a custom command 
special for precompiled header using relative path ?
Cordials,
Estrada Matthieu
Service Informatique / Intégration
 
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to