[CMake] target_link_libraries and Custom Properties

2018-05-09 Thread Marek Vojtko (Firaxis)
Hi,

I have multiple library targets that each provide shader files and headers. I 
also have multiple executable targets that each depend on a different set of 
these library targets. The executable targets need to collect the shader files 
and headers of only the libraries they depend on in order to compile them.

The ideal solution would be to reproduce the transitive dependency behavior 
controlled by target_link_libraries on a custom target property [0], but as far 
as I can tell define_property does not do that - it just creates a property on 
a target that can be queried but is not part of the dependency chain. I also 
wasn't able to find a way to get a list of targets a given target depends on, 
so that I could run through it and query each dependent target's custom 
property manually.

Variables do not solve this problem, because different executables depend on 
different libraries. Each library would need to know a) about all executables, 
and b) whether a particular executable depended on said library in order to be 
able to add the shader files and headers to a per-executable variable.

Is there a way to achieve this in CMake?

[0] CMake has a set of properties that get propagated according to the 
transitive dependency rules (PRIVATE, INTERFACE, PUBLIC) using 
target_link_libraries (e.g. COMPILE_DEFINITIONS, COMPILE_OPTIONS, 
INCLUDE_DIRECTORIES, etc.). I would like to add a custom property, for example 
SHADER_SOURCES, and have it propagate the same way, i.e. target A that depends 
on targets B, C, and D would have the INTERFACE_SHADER_SOURCES of targets B, C, 
and D in its SHADER_SOURCES property.
--
Marek Vojtko
mail: marek.voj...@firaxis.com
phone: (+1) 410-229-2519

-- 

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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] IMPORTED DLL-only Target on MSVC

2018-04-03 Thread Marek Vojtko (Firaxis)
> > Is it not possible to wrap an external DLL-only library in an IMPORTED 
> > target?
> > 
> 
> Yes it is.
> 
> > I have an external dependency that is a single DLL (shared library) and a
> > header file, but no LIB (static library) file.
> 
> How does this work in Visual Studio C++? If I am not completely mistaken you
> ALWAYS need a .lib file along with your .dll to link to the shared library. 
> And you
> Need a header with the API as well of course.
> 
> The only case I know with .dll and without .lib file is when you have managed
> C++ or C# targets.
>

The DLL gets loaded using LoadLibrary("MyDependency.dll") at runtime and its 
functions are accessed through GetProcAddress():

HINSTANCE hLib = LoadLibrary(DLL_NAME);
If(hLib)
{
typedef int (*DLL_FUNC)();
myFunc = (DLL_FUNC)GetProcAddress(hLib, "DLLFunction");
}

Like I said, it's an external dependency and I don't have any control over it. 
The dependency's include directories have to be added to my executable's 
include directories and I need to copy the DLL next to the executable. I 
thought I'd solve (at least the include directories) by creating an IMPORTED 
target, but no matter what I try, the DLL ends up in the linker command line, 
wreaking havoc.

Of course I can work around this issue by not creating an IMPORTED target and 
just relying on two variables (MyDependency_INCLUDE_DIR and 
MyDependency_SHARED_LIB). Before I do, however, I wanted to make sure that 
CMake does not in fact support a DLL-and-header-only library set up.

Thanks,
Marek

-- 

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:
https://cmake.org/mailman/listinfo/cmake


[CMake] IMPORTED DLL-only Target on MSVC

2018-04-02 Thread Marek Vojtko (Firaxis)
Hi,

Is it not possible to wrap an external DLL-only library in an IMPORTED target?

I have an external dependency that is a single DLL (shared library) and a 
header file, but no LIB (static library) file. When I create an IMPORTED target 
and depend on it via target_link_libraries() I run into linkage issues, because 
on MSVC CMake puts the DLL into the linker command (the "Input" text field in 
the "Linker" settings of the Project Properties).

add_library( MyDependency::MyDependency MODULE IMPORTED )
set_target_properties( MyDependency::MyDependency
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${MyDependency_INCLUDE_DIR}"
IMPORTED_LOCATION "${MyDependency_SHARED_LIB}"
)
[..]
add_executable( MyExecutable ... )
target_link_libraries( MyExecutable PRIVATE MyDependency::MyDependency )

I tried changing the library type in my add_library() call:
- STATIC obviously didn't work, because I don't have a .lib file and the .dll 
file in IMPORTED_LOCATION was added to MyExecutable's linker line.
- SHARED did not work because CMake expects a .dll in IMPORTED_LOCATION and a 
.lib in IMPORTED_IMP_LOCATION, so MyExecutable's linker line had a 
MyDependency::MyDependency-NOTFOUND entry in it.
- MODULE seemed like the right choice when reading the documentation, but 
MyExecutable's linker line still contains the .dll file specified in 
IMPORTED_LOCATION.

What am I doing wrong?

Thanks,
Marek

-- 

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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Custom Configurations and CMAKE__FLAGS__INIT

2018-03-22 Thread Marek Vojtko (Firaxis)
It turns out, as of CMake 3.11, this works.

Thanks to Beren Minor's commit 48f7e2d3, CMake 3.11 has a new 
CMakeInitializeConfigs.cmake module that handles all _INIT variables, even 
custom configuration ones, correctly.

Yay!

[0] 
https://gitlab.kitware.com/cmake/cmake/commit/48f7e2d3dc57c31d3e3ab81077950704a587

> Hi,
> 
> Do CMAKE__FLAGS__INIT variables not automatically populate 
> CMAKE__FLAGS_ variables for *custom* > configurations? 
> 
> When I use the _INIT variables for one of the default configuration names, 
> e.g. CMAKE_C_FLAGS_DEBUG_INIT or > CMAKE_C_FLAGS_RELEASE_INIT, they correctly 
> populate their "usage" counterparts, i.e. CMAKE_C_FLAGS_DEBUG and > 
> CMAKE_C_FLAGS_RELEASE respectively.
> 
> But when I set the _INIT variables for a custom configuration name (created 
> through CMAKE_CONFIGURATION_TYPES), e.g. > CMAKE_C_FLAGS_LALALAND_INIT, CMake 
> fails the compiler tests, because CMAKE_C_FLAGS_LALALAND does not exist.
> 
> My setup:
> 
> *CMakeLists.txt*
> set( CMAKE_USER_MAKE_RULES_OVERRIDE 
> "${CMAKE_CURRENT_LIST_DIR}/CompilerOptions.cmake" )
> project( Test )
> add_executable( "${CMAKE_CURRENT_LIST_DIR}/main.c" )
> 
> *CompilerOptions.cmake*
> set( CMAKE_CONFIGURATION_TYPES "Debug" "Release" "Lalaland" )
> 
> set( CMAKE_C_FLAGS_DEBUG_INIT "/Od" )
> set( CMAKE_C_FLAGS_RELEASE_INIT "/Ox" )
> set( CMAKE_C_FLAGS_LALALAND_INIT "/Ob2" )
> 
> set( CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/machine:x64" )
> set( CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "/machine:x64" )
> set( CMAKE_EXE_LINKER_FLAGS_LALALAND_INIT "/machine:x64" )
> 
> The error I get is:
> 
> > CMake Error: Error required internal CMake variable not set, cmake may not 
> > be built correctly.
> > Missing variable is:
> > CMAKE_C_FLAGS_LALALAND
> 
> > CMake Error: Error required internal CMake variable not set, cmake may not 
> > be built correctly.
> > Missing variable is:
> > CMAKE_EXE_LINKER_FLAGS_LALALAND
> 
> > CMake Error at C:/Program 
> > Files/CMake/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:37 
> > (try_compile):
> > Failed to generate test project build system.
> 
> This is just a simplified example, in my actual usecase I have two custom 
> configurations and both fail to populate their > CMAKE__FLAGS_ 
> variables from their CMAKE__FLAGS__INIT variables.
> 
> Do I have to set the CMAKE__FLAGS__INIT variables for the 
> default CMake configuration names, but set the > actual 
> CMAKE__FLAGS_ variables for any custom configurations?
> 
> I am using CMake 3.10.3 and Visual Studio 11/14 Win64 generator.
> 
> Thanks,
> Marek

-- 

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:
https://cmake.org/mailman/listinfo/cmake


[CMake] Custom Configurations and CMAKE__FLAGS__INIT

2018-03-21 Thread Marek Vojtko (Firaxis)
Hi,

Do CMAKE__FLAGS__INIT variables not automatically populate 
CMAKE__FLAGS_ variables for *custom* configurations? 

When I use the _INIT variables for one of the default configuration names, e.g. 
CMAKE_C_FLAGS_DEBUG_INIT or CMAKE_C_FLAGS_RELEASE_INIT, they correctly populate 
their "usage" counterparts, i.e. CMAKE_C_FLAGS_DEBUG and CMAKE_C_FLAGS_RELEASE 
respectively.

But when I set the _INIT variables for a custom configuration name (created 
through CMAKE_CONFIGURATION_TYPES), e.g. CMAKE_C_FLAGS_LALALAND_INIT, CMake 
fails the compiler tests, because CMAKE_C_FLAGS_LALALAND does not exist.

My setup:

*CMakeLists.txt*
set( CMAKE_USER_MAKE_RULES_OVERRIDE 
"${CMAKE_CURRENT_LIST_DIR}/CompilerOptions.cmake" )
project( Test )
add_executable( "${CMAKE_CURRENT_LIST_DIR}/main.c" )

*CompilerOptions.cmake*
set( CMAKE_CONFIGURATION_TYPES "Debug" "Release" "Lalaland" )

set( CMAKE_C_FLAGS_DEBUG_INIT "/Od" )
set( CMAKE_C_FLAGS_RELEASE_INIT "/Ox" )
set( CMAKE_C_FLAGS_LALALAND_INIT "/Ob2" )

set( CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/machine:x64" )
set( CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "/machine:x64" )
set( CMAKE_EXE_LINKER_FLAGS_LALALAND_INIT "/machine:x64" )

The error I get is:

> CMake Error: Error required internal CMake variable not set, cmake may not be 
> built correctly.
> Missing variable is:
> CMAKE_C_FLAGS_LALALAND

> CMake Error: Error required internal CMake variable not set, cmake may not be 
> built correctly.
> Missing variable is:
> CMAKE_EXE_LINKER_FLAGS_LALALAND

> CMake Error at C:/Program 
> Files/CMake/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:37 
> (try_compile):
> Failed to generate test project build system.

This is just a simplified example, in my actual usecase I have two custom 
configurations and both fail to populate their CMAKE__FLAGS_ 
variables from their CMAKE__FLAGS__INIT variables.

Do I have to set the CMAKE__FLAGS__INIT variables for the default 
CMake configuration names, but set the actual CMAKE__FLAGS_ 
variables for any custom configurations?
 
I am using CMake 3.10.3 and Visual Studio 11/14 Win64 generator.

Thanks,
Marek

-- 

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:
https://cmake.org/mailman/listinfo/cmake


[CMake] Copying Shared Libraries (DLLs) Next to the Executable

2018-02-21 Thread Marek Vojtko (Firaxis)
Hi,

I need to copy external shared libraries (DLLs on Windows) next to the 
generated executable. Is calling "cmake -E copy_if_different" through a custom 
command added to the executable target still the best way to achieve this? 
CMake tracks include directories, compile definitions or options, link flags, 
etc. through its dependency system, but it doesn't provide an easy way to list 
/ copy all shared libraries a target depends on?

I am trying to follow the "new" CMake paradigms, using add_subdirectory(), 
set_target*() with PUBLIC/PRIVATE/INTERFACE scope, etc. to create a modular, 
re-usable setup, but that actively prevents me from using a custom command on 
the executable target. To wit:

App depends on Lib. Lib depends on several third-party, pre-built DLLs and 
encapsulates the logic of when to depend on them. The third-party, pre-built 
shared libraries (DLLs) are located through custom Find*.cmake modules and used 
as IMPORTED targets.

/CMakelists.txt
/App
/CMakelists.txt
/Lib
/CMakelists.txt

/CMakelists.txt
*
set(CMAKE_MODULE_PATH "")
project("DLLTest")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/Lib")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/App")

/App/CMakelists.txt
*
add_executable(App WIN32 main.cpp)
target_link_libraries(App PRIVATE Lib)

/Lib/CMakelists.txt

add_library(Lib STATIC lib.h lib.cpp)
target_include_directories(Lib PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")

if(Lib_NEEDS_DEPENDENCY)
find_package(Dependency REQUIRED)
target_link_libraries(Lib PUBLIC Dependency::Dependency)
endif()

FindDependency.cmake

[snip]
add_library(Dependency::Dependency SHARED IMPORTED)
set_target_properties(Dependency::Dependency PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "inc"
IMPORTED_IMPLIB "dependency.lib"
IMPORTED_LOCATION "dependency.dll"
)

In this setup, it is impossible to propagate a shared library (DLL) from Lib to 
App. This is because Lib and App have different BINARY_DIRs and Lib must create 
its target before App calls target_link_libraries(). That means that Lib does 
not know where App will generate its executable. If Lib is a SHARED target, I 
cannot set its RUNTIME_OUTPUT_DIRECTORY to be the same as App's. If Lib depends 
on IMPORTED targets (as is my case), I cannot create either a file(COPY) step, 
or an install(FILES) step, or even an add_custom_command() step in Lib to copy 
the shared library, because I don't know the destination.

The only solution, it would seem, is to add a custom command to App's target, 
because then I know where to copy the shared libraries to. But that means that 
App now has to know it needs to copy a shared library from a "hidden" 
dependency of Lib. App also needs to know about every SHARED or IMPORTED target 
Lib depends on, not to mention duplicate the logic in Lib's CMakelists.txt that 
decided whether Lib depends on Dependency in the first place.

I was looking into GetPrerequisites and FixupBundle, but both of those operate 
on an already existing executable and try to guess what shared libraries (DLLs) 
it might need. It feels silly to guess at something that CMake already knows 
(as the IMPORTED target sets the IMPORTED_IMPLIB and IMPORTED_LOCATION 
properties).

Setting a common CMAKE_RUNTIME_OUTPUT_DIRECTORY for both App and Lib is 
problematic if I have multiple executables in my root CMakelists.txt and they 
depend on different versions of the shared libraries or I have other name 
clashes.

Is there no automated way to get the list of shared libraries a target depends 
on?

Thanks,
Marek
-- 

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:
https://cmake.org/mailman/listinfo/cmake


[CMake] Apple Metal Support in Xcode?

2015-04-28 Thread Marek Vojtko (Firaxis)
Hi,

I'm trying to get Apple's new shading language, Metal, to work with my CMake 
project, but I am not having any luck.

Xcode will automagically compile .metal files that are part of the project, but 
their Type (in the File Inspector in the right-hand Utilities pane) has to be 
set to Default - Metal Shader Source File. 

When I add .metal files via CMake they are a) not listed in the project's 
Compile Sources list (in the Target's Build Phases tab), and b) their Type is 
set to Source File. A) can be solved by adding source file properties (e.g. 
compile flags) to the .metal file in CMake, but I haven't been able to change 
the Type of the .metal files through CMake.

I have seen a commit log  [0] about Add[ing] file type for Metal shader 
files, but that change doesn't seem to have made it to the released CMake 
version yet. 

My questions:
1) Is there anything I can do right now (with CMake 3.2.2.) that would make 
Xcode handle .metal files correctly?
2) Are there plans to support .metal files via CMake and if so, how far along 
are they?

Thanks,

[0] http://www.cmake.org/pipermail/cmake-commits/2015-April/022952.html
--
Marek Vojtko
mail: marek.voj...@firaxis.com
phone: (+1) 410-229-2519

-- 

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


[CMake] Variable Containing MSVC and MATCHES

2014-03-12 Thread Marek Vojtko (Firaxis)
Hi,

I know that MSVC is a CMake keyword and it is therefore not a good idea to use 
the string MSVC as the value for any variable, e.g. set( compiler MSVC ), 
because if you aren't careful and interpret such a variable without surrounding 
it with quotes (e.g. ${compier} rather than ${compiler}) you will get 0 or 1 
depending on whether you are using a Visual Studio generator or not. So far so 
good.

However, I was caught off guard by the fact that the MATCHES directive (for 
regex matching) inside an IF() statement is apparently interpreting the strings 
passed to it. Consider the following code:

if( MSVC11 MATCHES MSVC[0-9]+ )
message( STATUS MSVC11 matches MSVC[0-9]+ )
endif()

if( TEST11 MATCHES TEST[0-9]+ )
message( STATUS TEST11 matches TEST[0-9]+ )
endif()

The first MATCHES does not enter the IF() statement, while the second does. I'm 
guessing that the string MSVC11 (or the regular expression MSVC[0-9]+) is 
interpreted before regular expression matching can take place and MSVC11 
becomes 111 or true11 (or the regular expression MSVC[0-9]+ becomes 
1[0-9]+ or true[0-9]+).

Putting either the string or the regex or both into variables doesn't help 
either. The only thing that prevents MSVC from being interpreted is putting 
extra quotes into both the string and the regexp, i.e. \MSVC11\ MATCHES 
\MSVC[0-9]+\.

Is there any type of interpretation happening on either the string or the regex 
in an IF( MATCHES ) statement? If this is by design, i.e. not a bug, what are 
the reasons for this?

Thanks,

P.S.: The following is an example CMakeLists.txt that demonstrates the problem 
for easy testing:

cmake_minimum_required( VERSION 2.8.12 )

set( test MSVC11 )
message( STATUS Start matching string \${test}\ ... )

message( STATUS )
set( regex MSVC )
message( STATUS ... against regular expression: ${regex} )
if( ${test} MATCHES ${regex} )
message( STATUS \t\${test}\ matches regular expression: ${regex} )
else()
message( STATUS \t\${test}\ DOES NOT match regular expression: ${regex} 
)
endif()

message( STATUS )
set( regex MSVC. )
message( STATUS ... against regular expression: ${regex} )
if( ${test} MATCHES ${regex} )
message( STATUS \t\${test}\ matches regular expression: ${regex} )
else()
message( STATUS \t\${test}\ DOES NOT match regular expression: ${regex} 
)
endif()

message( STATUS )
set( regex MSVC[0-9] )
message( STATUS ... against regular expression: ${regex} )
if( ${test} MATCHES ${regex} )
message( STATUS \t\${test}\ matches regular expression: ${regex} )
else()
message( STATUS \t\${test}\ DOES NOT match regular expression: ${regex} 
)
endif()

message( STATUS )
set( regex MSVC[0-9]+ )
message( STATUS ... against regular expression: ${regex} )
if( ${test} MATCHES ${regex} )
message( STATUS \t\${test}\ matches regular expression: ${regex} )
else()
message( STATUS \t\${test}\ DOES NOT match regular expression: ${regex} 
)
endif()

message( STATUS )
message( STATUS End matching ${test} ... )

message( STATUS )
message( STATUS )
message( STATUS )

set( test2 test11 )
message( STATUS Start matching ${test2} ... )

message( STATUS )
set( regex test )
message( STATUS ... against regular expression: ${regex} )
if( ${test2} MATCHES ${regex} )
message( STATUS \t\${test2}\ matches regular expression: ${regex} )
else()
message( STATUS \t\${test2}\ DOES NOT match regular expression: 
${regex} )
endif()

message( STATUS )
set( regex test. )
message( STATUS ... against regular expression: ${regex} )
if( ${test2} MATCHES ${regex} )
message( STATUS \t\${test2}\ matches regular expression: ${regex} )
else()
message( STATUS \t\${test2}\ DOES NOT match regular expression: 
${regex} )
endif()

message( STATUS )
set( regex test[0-9] )
message( STATUS ... against regular expression: ${regex} )
if( ${test2} MATCHES ${regex} )
message( STATUS \t\${test2}\ matches regular expression: ${regex} )
else()
message( STATUS \t\${test2}\ DOES NOT match regular expression: 
${regex} )
endif()

message( STATUS )
set( regex test[0-9]+ )
message( STATUS ... against regular expression: ${regex} )
if( ${test2} MATCHES ${regex} )
message( STATUS \t\${test2}\ matches regular expression: ${regex} )
else()
message( STATUS \t\${test2}\ DOES NOT match regular expression: 
${regex} )
endif()

message( STATUS )
message( STATUS End matching ${test2} ... )
--
Marek Vojtko
mail: marek.voj...@firaxis.com
phone: (+1) 410-229-2519


-- 

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 

Re: [CMake] CMake Tools for Visual Studio 1.0 Released!

2013-08-26 Thread Marek Vojtko (Firaxis)
 On Mon, 26 Aug 2013 16:30:08 +0200, Niels Dekker wrote:

 On 2013-08-26 14:33, David Golub wrote:
 The two version differ solely in their version number, as there
 were no bugs reported in RC3.

 Actually, I did report an issue on RC3, asking for lowercase code 
 completion of CMake commands: http://cmaketools.codeplex.com/workitem/2 
  What do you think?

In Visual Studio: Tools - Options - CMake Tools under Misc the very first 
option is Commands In Lowercase.
--
Marek Vojtko
mail: marek.voj...@firaxis.com

--

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://www.cmake.org/mailman/listinfo/cmake


[CMake] MACOSX_PACKAGE_LOCATION Not Working?

2013-05-07 Thread Marek Vojtko (Firaxis)
Hi,

I am trying to copy assets (textures) into an application bundle in my 
project's CMake file. The solution that has brought me the closest was the 
following:

// ${ASSETS_DIR} points to a directory in my project that contains the textures
file( GLOB Textures ${ASSETS_DIR}/*.dds )
file( GLOB Sources *.cpp *.h )

set_property( SOURCE ${Textures} PROPERTY MACOSX_PACKAGE_LOCATION Assets )

add_executable( MyProject MACOSX_BUNDLE ${Sources} ${Textures} )

set_target_properties( MyProject PROPERTIES RESOURCE ${Textures} )

This gets me as far as having all my textures in the application bundle, but it 
seems to ignore the MACOSX_PACKAGE_LOCATION because the textures end up in the 
same (root) directory as the executable and not the in specified Assets 
directory.

Am I missing something or doing something wrong? Is there a way to have CMake 
copy my textures into the application bundle in a specific directory?

Thanks,
--
Marek Vojtko
mail: marek.voj...@firaxis.com
phone: (+1) 410-229-2519
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake